setTimeout(function() {
  var a = 'hello';
  setTimeout(function() {
      var b = 'lagou';
      setTimeout(function() {
          var c = 'I ❤ U';
          console.log(a + b + c);
      }, 10);
  }, 10);
}, 10);

function f1 () {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve('hello')
    }, 10);
  })
}
function f2 () {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve('lagou')
    }, 10);
  })
}
function f3 () {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve('I ❤️ U')
    }, 10);
  })
}

var a, b, c;
f1().then(value => {
  a = value;
  return f2();
}).then((value) => {
  b = value;
  return f3();
}).then(value => {
  c = value;
  console.log(a + b + c);
})